package com.ruoyi.demo.mapper;

import com.ruoyi.demo.domain.CreatedMeet;
import com.ruoyi.system.domain.Meet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MeetUserDetailMapper {

    // 获取会议详细信息
    @Select("SELECT \n" +
            "meet.*,\n" +
            "room.room_address,\n" +
            "sys_user.user_name\n" +
            "FROM meet \n" +
            "JOIN room ON meet.room_id = room.room_id\n" +
            "JOIN sys_user ON meet.user_id = sys_user.user_id\n" +
            "WHERE meet_id = #{meetId}")
    CreatedMeet getMeetById(Long meetId);

    // 获取参会人员的用户名
    @Select("SELECT u.user_name FROM meet_user mu JOIN sys_user u ON mu.user_id = u.user_id WHERE mu.meet_id = #{meetId}")
    List<String> getAttendeesByMeetId(Long meetId);
}
